{#
    cdap-navbar.html
    ================
    Sphinx navbar template for cdap-bootstrap theme.
    :copyright: Copyright 2017 Cask Data, Inc.
    :license: Apache License, Version 2.0
#}
{%- set CDAP_DOCS = 'CDAP Documentation' -%}
{%- set master_url_root = pathto(master_doc, 1) -%}
{%- if master_url_root == '#' %}{% set master_url_root = '' %}{% endif -%}
{%- if html_short_title_toc != CDAP_DOCS %}{% set master_url_root =  master_url_root + '/..' %}{%- endif -%}
  <div id="navbar" class="{{ theme_navbar_class }} navbar-default {% if theme_navbar_fixed_top|tobool -%} navbar-fixed-top{%- endif -%}">
    <div class="container-fluid">
      <div class="row">
        <div class="navbar-header">
          <!-- .btn-navbar is used as the toggle for collapsed navbar content -->
          <a class="navbar-brand" href="{{ master_url_root + '/../index.html' }}">
            <span><img alt="CDAP logo" src="{{ pathto('_static/cdap_logo.svg', 1) }}"/></span>
          </a>

          <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".nav-collapse">
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>

          <div class="pull-right">
            <div class="dropdown version-dropdown">
              <a href="#" class="dropdown-toggle" data-toggle="dropdown"
                role="button" aria-haspopup="true" aria-expanded="false">
                v {{ version|e }} <span class="caret"></span>
              </a>
              <ul class="dropdown-menu">
                <li><a href="//docs.cdap.io/cdap/5.1.2/en/index.html">v 5.1.2</a></li>
                <li><a href="//docs.cdap.io/cdap/4.3.4/en/index.html">v 4.3.4</a></li>
              </ul>
            </div>
          </div>

          {%- if pagename != "search" %}
          <form class="navbar-form navbar-right navbar-search" action="{{ pathto('search') }}" method="get">
            <div class="form-group">
              <div class="navbar-search-image material-icons"></div>
              <input type="text" name="q" class="form-control" placeholder="  Search" />
            </div>
            <input type="hidden" name="check_keywords" value="yes" />
            <input type="hidden" name="area" value="default" />
          </form>
          {%- endif %}

          <div class="collapse navbar-collapse nav-collapse navbar-right navbar-navigation">
            <ul class="nav navbar-nav">
            {%- for manual_set, manual_title, manual_href in theme_navbar_list -%}
              {% set highlight_class = '' -%}
              {%- if manual_set == theme_manual_highlight %}{% set highlight_class = 'current' %}{%- endif -%}
              {%- if theme_manual == '' and (manual_href == (pagename + '.html')) %}{% set highlight_class = 'current' %}{%- endif -%}
              <li class="docsite-nav-tab-container"><a class="docsite-nav-tab-link {{ highlight_class }}" href="{{ master_url_root + '/../' + manual_href }}">{{ manual_title }}</a></li>
            {%- endfor %}
            </ul>
          </div>

        </div>
      </div>
    </div>
  </div>
